home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / disk_utl / advapp / frmpathw.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-12  |  4.6 KB  |  149 lines

  1. VERSION 2.00
  2. Begin Form frmPathWord 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Split Path Word"
  6.    ClientHeight    =   2760
  7.    ClientLeft      =   1110
  8.    ClientTop       =   1470
  9.    ClientWidth     =   5790
  10.    Height          =   3165
  11.    Left            =   1050
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   2760
  14.    ScaleWidth      =   5790
  15.    Top             =   1125
  16.    Width           =   5910
  17.    Begin PictureBox Picture1 
  18.       BackColor       =   &H00C0C0C0&
  19.       Height          =   1575
  20.       Left            =   240
  21.       ScaleHeight     =   1545
  22.       ScaleWidth      =   3825
  23.       TabIndex        =   10
  24.       Top             =   1080
  25.       Width           =   3855
  26.       Begin OptionButton optSplit 
  27.          BackColor       =   &H00C0C0C0&
  28.          Caption         =   "Return the File Extension."
  29.          Height          =   255
  30.          Index           =   3
  31.          Left            =   120
  32.          TabIndex        =   4
  33.          Top             =   1200
  34.          Width           =   3375
  35.       End
  36.       Begin OptionButton optSplit 
  37.          BackColor       =   &H00C0C0C0&
  38.          Caption         =   "Return the File Name."
  39.          Height          =   255
  40.          Index           =   2
  41.          Left            =   120
  42.          TabIndex        =   3
  43.          Top             =   840
  44.          Width           =   3375
  45.       End
  46.       Begin OptionButton optSplit 
  47.          BackColor       =   &H00C0C0C0&
  48.          Caption         =   "Return the Directory."
  49.          Height          =   255
  50.          Index           =   1
  51.          Left            =   120
  52.          TabIndex        =   2
  53.          Top             =   480
  54.          Width           =   3375
  55.       End
  56.       Begin OptionButton optSplit 
  57.          BackColor       =   &H00C0C0C0&
  58.          Caption         =   "Return the Drive."
  59.          Height          =   255
  60.          Index           =   0
  61.          Left            =   120
  62.          TabIndex        =   1
  63.          Top             =   120
  64.          Width           =   3375
  65.       End
  66.    End
  67.    Begin CommandButton cmdCancel 
  68.       Caption         =   "&Exit"
  69.       Height          =   375
  70.       Left            =   4440
  71.       TabIndex        =   6
  72.       Top             =   2040
  73.       Width           =   1095
  74.    End
  75.    Begin CommandButton cmdOK 
  76.       Caption         =   "&OK"
  77.       Height          =   375
  78.       Left            =   4440
  79.       TabIndex        =   5
  80.       Top             =   1320
  81.       Width           =   1095
  82.    End
  83.    Begin TextBox txtPath 
  84.       Height          =   285
  85.       Left            =   1800
  86.       TabIndex        =   0
  87.       Text            =   "Text1"
  88.       Top             =   240
  89.       Width           =   3735
  90.    End
  91.    Begin Label Label3 
  92.       BackColor       =   &H00C0C0C0&
  93.       Caption         =   "Returned Word"
  94.       Height          =   255
  95.       Left            =   240
  96.       TabIndex        =   9
  97.       Top             =   720
  98.       Width           =   1455
  99.    End
  100.    Begin Label Label2 
  101.       BackColor       =   &H00C0C0C0&
  102.       Caption         =   "Enter Path:"
  103.       Height          =   255
  104.       Left            =   240
  105.       TabIndex        =   8
  106.       Top             =   240
  107.       Width           =   1455
  108.    End
  109.    Begin Label lblSplitWord 
  110.       BackColor       =   &H00C0C0C0&
  111.       BorderStyle     =   1  'Fixed Single
  112.       Height          =   255
  113.       Left            =   1800
  114.       TabIndex        =   7
  115.       Top             =   720
  116.       Width           =   3735
  117.    End
  118. '''''''''''''''''''''''''''''''''''''''''''''''''
  119. ' Copyright by Advanced Applications 1994 - 1995
  120. ' All rights reserved
  121. '''''''''''''''''''''''''''''''''''''''''''''''''
  122. Dim nValue As Integer
  123. Sub cmdCancel_Click ()
  124.     Me.Hide
  125.     DoEvents
  126. End Sub
  127. Sub cmdOK_Click ()
  128.     szBuffer$ = String(255, 0)
  129.     If txtPath.Text = "" Then Exit Sub
  130.     strPath$ = txtPath.Text
  131.     nLength% = PathSplit(strPath$, szBuffer$, nValue)
  132.     If nLength% = 0 Then
  133.         MsgBox "Cannot Split request", MB_ICONSTOP, "Split Return Error"
  134.         Exit Sub
  135.     End If
  136.     strWord$ = Left$(szBuffer$, nLength%)
  137.     lblSplitWord.Caption = strWord$
  138. End Sub
  139. Sub Form_Load ()
  140.     Left = (Screen.Width - Width) / 2   ' Center form horizontally.
  141.     Top = (Screen.Height - Height) / 2  ' Center form vertically.
  142.     optSplit(1).Value = True            ' Default to Directory
  143.     nValue = 1
  144.     txtPath.Text = ""
  145. End Sub
  146. Sub optSplit_Click (Index As Integer)
  147.     nValue = Index
  148. End Sub
  149.